﻿using BusinessDB;
using BusinessService;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LightingTcpService
{
    [CommandID(1)]
    public class ImportProdPackage : BusinessCommand
    {
        public override byte[] Excute(byte[] bytes)
        {
            ProdFactory factory = new ProdFactory();
            IList<ProdDB> list = factory.Create(bytes);

            OriginalBusiness business = new OriginalBusiness();
            foreach (ProdDB prodDB in list)
            {
                business.AddProd(prodDB);
            }

            return new byte[] { 1 };
        }
    }
}
